package com.example.myyiyanmengjava.presenter;

import com.example.mvplibrary.callback.BaseModelCallback;
import com.example.mvplibrary.presenter.BasePresenter;
import com.example.myyiyanmengjava.callback.Mainconcations;
import com.example.myyiyanmengjava.model.HomeModel;
import com.example.myyiyanmengjava.view.HomeView;

import java.util.HashMap;

public class HomePresenter<T> extends BasePresenter<Mainconcations.MainView, HomeModel> implements BaseModelCallback<T> {

    @Override
    public void onError(String message, int code) {
        getView().showError(message);
    }

    @Override
    public void onSuccess(T t, int type) {
        getView().showList(t, type);
    }

    public void getData(HashMap<String, Object> paramser, String baseUrl, String ApiUrl, int type) {
        getModel().getData(this, getLifecycleProvider(), paramser, baseUrl, ApiUrl, type);
    }
}
